#include "Tile.h"


Tile::Tile(void)
{
}

Tile::Tile(string path)
{
	loadData(path);
	path += "/image.txt";
	_image.LoadImage(path);
}
Tile::~Tile(void)
{
}

// Load the Data for the tile
void Tile::loadData(string loc)
{
	loc += "/data.txt";

	ifstream myfile (loc);
	string data;

	// if it's open
	if(myfile.is_open())
	{
		myfile >> data;
		_data = atoi(data.c_str());

		myfile.close();
	}
	else
		_data = 0;

}

// Return if the Tile is Walkable
bool Tile::isWalkable()
{
	return _data;
}
